<?php

class Base {
	public $useConnection = true;
	public $className;
	public $useTable;
	
	public function __construct() {
		$this->className = get_class($this);
	
		if ($this->useConnection == true) {
			if (!isset($this->useTable)) {
				$this->useTable = Inflector::tableize($this->className);
			}
		
			$this->{$this->getClassName()} = new DataLayer($this->useTable, true);
		} else {
			$this->{$this->getClassName()} = new DataLayer(null, false);
		}
	}
	
	public function getClassName() {
		return $this->className;
	}
}

?>